package cn.hbwe.controller;


import cn.hbwe.pojo.dto.PayDto;
import cn.hbwe.service.IPayService;
import cn.hbwe.util.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 7组
 * @since 2023-10-18
 */
@RestController
@RequestMapping("/pay")
@Api(tags = "支付类")
@CrossOrigin
public class PayController {

    @Autowired
    private IPayService payService;

    /**
     * 支付功能
     * @param payDto
     * @return
     */
    @PostMapping("/pay")
    @ApiOperation("支付功能")
    public Result<String> pay(@RequestBody PayDto payDto) {
        payService.pay(payDto);
        return Result.success("支付成功");
    }

}
